/* 
 * File:   Game.h
 * Author: mvdr
 *
 * Created on March 19, 2013, 3:01 PM
 */

#ifndef GAME_H
#define	GAME_H

#include "Model.h"
#include "Question.h"
#include <vector>

class Game {
    
    Model d_model;    
    Questions d_questions;
    std::vector<int> d_questionStack;
    std::vector<int> d_stateStack;
    int d_currState;
    int d_stateCounter;
    size_t d_currPlayer;
    bool d_magic;
    bool d_verbose;
    
    
public:
    Game(bool magic, bool verbose);
    std::vector<size_t> run();
    int nStates();
    
private:
    void shuffleQuestions();
    std::vector<size_t> startPlaying();
    void updateModel(bool ans, int currQuestion);
    bool anybodyKnows() const;
    size_t numberOfWinners() const;
    void epistemagic();
    void printInfo() const;
    
    void because(std::vector<int> const &players);
};

inline int Game::nStates() {
    return d_model.numberOfStates();
}

#endif	/* GAME_H */

